﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleKit.Reflection
{
    public class CSharpReflection
    {
        public int test1;
        public int test2;

        public CSharpReflection()
        {

        }

        public static void CSharpReflectionMain(string[] args)
        {
            BindingFlags bindingFlags = BindingFlags.Public |
                            BindingFlags.NonPublic |
                            BindingFlags.Instance |
                            BindingFlags.Static;

            foreach (FieldInfo field in typeof(CSharpReflection).GetFields(bindingFlags))
            {
                Console.WriteLine(field.Name + "  " + field.FieldType.ToString());
            }

            Assembly thisAsm = Assembly.GetExecutingAssembly();
            List<Type> types = thisAsm.GetTypes().Where(t => t.IsClass && !t.IsAbstract).ToList();

            foreach (Type t in types)
            {
                Console.WriteLine(t.ToString());
            }
        }
    }
}
